package com.nbjtjc.safe.mapper.safe;

import com.nbjtjc.safe.model.safe.SafeDangerInspectTaskRecord;
import com.nbjtjc.safe.model.sys.SysFile;
import com.nbjtjc.util.MyMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SafeDangerInspectTaskRecordMapper extends MyMapper<SafeDangerInspectTaskRecord> {

    @Select("<script>"+
            "select * from safe_danger_inspect_task_record " +
            "where  inspect_table_public_list_id in" +
            " <foreach item='listId' index='index' collection='listIds'  open='(' separator=',' close=')'> " +
            "#{listId}" +
            " </foreach> "
            + "</script>")
    List<SafeDangerInspectTaskRecord> findByInspectListPublicId(@Param("listIds") List<Integer> listIds);

    List<SafeDangerInspectTaskRecord> search(@Param("tr") SafeDangerInspectTaskRecord taskRecord);

    @Delete("delete from safe_danger_inspect_task_record where inspect_task_id=#{taskId}")
    int deleteByTaskId(@Param("taskId") int taskId);
}